home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-1.iso
/
utility
/
horst_2.zip
/
LISTMOD.DOC
< prev
next >
Wrap
Text File
|
1995-12-18
|
3KB
|
82 lines
------------------------------------------------------------------------
LISTMOD list utility Ver 1.2 (c) 1994 Horst Schaeffer
------------------------------------------------------------------------
LISTMOD generates an output list (to STDOUT) using data from a given
input list (STDIN) - line by line.
Syntax: LISTMOD [options] string < input.txt > output.txt
The string is written into each output line, where $1...$99 are tokens
referring to the 1st....99th word of the input line.
If, for example, you want to execute: COPY <file> A:
for each file name in a given list, LISTMOD will generate a COPY
instruction for each file name and write it into a batch file.
listmod COPY $1 A: < input.lst > TMP.BAT
:: ==========
call TMP.BAT
The file names are inserted by token $1 referring to the 1st (and only)
word of each input line.
Variables and other symbols
---------------------------
$1..$99 refers to the n-th word of the input line
$0 the complete input line
$* same as $0
$( $! $) converts to: < | >
$# generates the 3-digit line number (see option /N)
$$ $
$L generates a carriage return / line feed.
(more than 1 line may be produced from each input line)
Options
-------
Options must be placed before the string.
/S... Separators (see below)
/Nnnn starting number for $# count (default is 001)
Separators (option /S)
----------------------
"Words" of an input line are separated by blank, comma, semicolon
or equal sign. These delimiters are never copied to output lines.
Additional separators may be defined with the /S option followed
by one or more symbols (terminated by a space).
Example: delete the 5th character from each *.DAT file name
(in the current directory)
ren *.DAT ????#???.DAT
dir *.DAT /B/A-D | LISTMOD /S# ren $1#$2 $1$2 > TMP.BAT
:: ^^^ ==============
call TMP.BAT
First the 5th character is replaced by "#" (REN).
Then a directory listing is piped into LISTMOD, where the "#"
is defined as an additional separator, dividing the file names
into $1 (????) and $2 (???.DAT).
Notes
-----
The input file is limited to 60 KB. The output file is not limited,
but the output line size must not exceed 1 KB.
For execution under MS-DOS a command line or any line in the resulting
batch file must not exceed 127 bytes.
If no input file is given LISTMOD shows a brief help information.
To avoid conflicts when numeric data occur in the string, you
may use e.g. $01 instead of $1 (because only 2 digits are read):
$15 is the 15th word
$015 is the 1st word succeeded by constant "5"
* 13 FEB 1994